/*
 * @Description: 
 * @Author: 于海龙
 * @Date: 2024-10-08 16:56:51
 * @LastEditors: 于海龙
 * @LastEditTime: 2024-10-08 16:56:55
 */
import java.util.Collection;

public class GenericMaxFinder {

    public static <T extends Comparable<T>> T findMax(Collection<T> collection) {
        T max = null;
        for (T element : collection) {
            if (max == null || element.compareTo(max) > 0) {
                max = element;
            }
        }
        return max;
    }
}
